package com.cat.greedyAlgorithm;

import javax.swing.text.Style;
import java.io.*;
import java.util.Arrays;

/**
 * @author 曲大人的喵
 * @description https://www.nowcoder.com/practice/2a9089ea7e5b474fa8f688eae76bc050
 * @create 2025/10/8 18:42
 * @since JDK17
 */

public class Solution57 {
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StreamTokenizer in = new StreamTokenizer(br);
    static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    static int N = 200001;
    static int[][] nums = new int[N][2];

    public static void main(String[] args) throws IOException {
        in.nextToken();
        int n = ((int) in.nval);
        for (int i = 0; i < n; i++) {
            in.nextToken();
            nums[i][0] = ((int) in.nval);
            in.nextToken();
            nums[i][1] = ((int) in.nval);
        }

        Arrays.sort(nums, (a, b) -> Math.abs(a[0] - a[1]) - Math.abs(b[0] - b[1]));
        int max1 = nums[0][0], max2 = nums[0][1], ans = 0;
        for (int i = 1; i < n; i++) {
            if (nums[i][0] < nums[i][1]) {
                ans = Math.max(ans, max1 + nums[i][0]);
            } else {
                ans = Math.max(ans, max2 + nums[i][1]);
            }
            max1 = Math.max(max1, nums[i][0]);
            max2 = Math.max(max2, nums[i][1]);
        }
        out.println((double) ans / 2);

        br.close();
        out.flush();
        out.close();
    }
}
